{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<table style=\"float:left; border:none\">\n",
    "   <tr style=\"border:none\">\n",
    "       <td style=\"border:none\">\n",
    "           <a href=\"https://bokeh.org/\">     \n",
    "           <img \n",
    "               src=\"assets/bokeh-transparent.png\" \n",
    "               style=\"width:50px\"\n",
    "           >\n",
    "           </a>    \n",
    "       </td>\n",
    "       <td style=\"border:none\">\n",
    "           <h1>Bokeh Tutorial</h1>\n",
    "       </td>\n",
    "   </tr>\n",
    "</table>\n",
    "\n",
    "<div style=\"float:right;\"><h2>06. Linking and Interactions</h2></div>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "    <div class=\"bk-root\">\n",
       "        <a href=\"https://bokeh.org\" target=\"_blank\" class=\"bk-logo bk-logo-small bk-logo-notebook\"></a>\n",
       "        <span id=\"1001\">Loading BokehJS ...</span>\n",
       "    </div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "(function(root) {\n",
       "  function now() {\n",
       "    return new Date();\n",
       "  }\n",
       "\n",
       "  var force = true;\n",
       "\n",
       "  if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n",
       "    root._bokeh_onload_callbacks = [];\n",
       "    root._bokeh_is_loading = undefined;\n",
       "  }\n",
       "\n",
       "  var JS_MIME_TYPE = 'application/javascript';\n",
       "  var HTML_MIME_TYPE = 'text/html';\n",
       "  var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n",
       "  var CLASS_NAME = 'output_bokeh rendered_html';\n",
       "\n",
       "  /**\n",
       "   * Render data to the DOM node\n",
       "   */\n",
       "  function render(props, node) {\n",
       "    var script = document.createElement(\"script\");\n",
       "    node.appendChild(script);\n",
       "  }\n",
       "\n",
       "  /**\n",
       "   * Handle when an output is cleared or removed\n",
       "   */\n",
       "  function handleClearOutput(event, handle) {\n",
       "    var cell = handle.cell;\n",
       "\n",
       "    var id = cell.output_area._bokeh_element_id;\n",
       "    var server_id = cell.output_area._bokeh_server_id;\n",
       "    // Clean up Bokeh references\n",
       "    if (id != null && id in Bokeh.index) {\n",
       "      Bokeh.index[id].model.document.clear();\n",
       "      delete Bokeh.index[id];\n",
       "    }\n",
       "\n",
       "    if (server_id !== undefined) {\n",
       "      // Clean up Bokeh references\n",
       "      var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n",
       "      cell.notebook.kernel.execute(cmd, {\n",
       "        iopub: {\n",
       "          output: function(msg) {\n",
       "            var id = msg.content.text.trim();\n",
       "            if (id in Bokeh.index) {\n",
       "              Bokeh.index[id].model.document.clear();\n",
       "              delete Bokeh.index[id];\n",
       "            }\n",
       "          }\n",
       "        }\n",
       "      });\n",
       "      // Destroy server and session\n",
       "      var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n",
       "      cell.notebook.kernel.execute(cmd);\n",
       "    }\n",
       "  }\n",
       "\n",
       "  /**\n",
       "   * Handle when a new output is added\n",
       "   */\n",
       "  function handleAddOutput(event, handle) {\n",
       "    var output_area = handle.output_area;\n",
       "    var output = handle.output;\n",
       "\n",
       "    // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n",
       "    if ((output.output_type != \"display_data\") || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n",
       "      return\n",
       "    }\n",
       "\n",
       "    var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n",
       "\n",
       "    if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n",
       "      toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n",
       "      // store reference to embed id on output_area\n",
       "      output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n",
       "    }\n",
       "    if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n",
       "      var bk_div = document.createElement(\"div\");\n",
       "      bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n",
       "      var script_attrs = bk_div.children[0].attributes;\n",
       "      for (var i = 0; i < script_attrs.length; i++) {\n",
       "        toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n",
       "        toinsert[toinsert.length - 1].firstChild.textContent = bk_div.children[0].textContent\n",
       "      }\n",
       "      // store reference to server id on output_area\n",
       "      output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n",
       "    }\n",
       "  }\n",
       "\n",
       "  function register_renderer(events, OutputArea) {\n",
       "\n",
       "    function append_mime(data, metadata, element) {\n",
       "      // create a DOM node to render to\n",
       "      var toinsert = this.create_output_subarea(\n",
       "        metadata,\n",
       "        CLASS_NAME,\n",
       "        EXEC_MIME_TYPE\n",
       "      );\n",
       "      this.keyboard_manager.register_events(toinsert);\n",
       "      // Render to node\n",
       "      var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n",
       "      render(props, toinsert[toinsert.length - 1]);\n",
       "      element.append(toinsert);\n",
       "      return toinsert\n",
       "    }\n",
       "\n",
       "    /* Handle when an output is cleared or removed */\n",
       "    events.on('clear_output.CodeCell', handleClearOutput);\n",
       "    events.on('delete.Cell', handleClearOutput);\n",
       "\n",
       "    /* Handle when a new output is added */\n",
       "    events.on('output_added.OutputArea', handleAddOutput);\n",
       "\n",
       "    /**\n",
       "     * Register the mime type and append_mime function with output_area\n",
       "     */\n",
       "    OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n",
       "      /* Is output safe? */\n",
       "      safe: true,\n",
       "      /* Index of renderer in `output_area.display_order` */\n",
       "      index: 0\n",
       "    });\n",
       "  }\n",
       "\n",
       "  // register the mime type if in Jupyter Notebook environment and previously unregistered\n",
       "  if (root.Jupyter !== undefined) {\n",
       "    var events = require('base/js/events');\n",
       "    var OutputArea = require('notebook/js/outputarea').OutputArea;\n",
       "\n",
       "    if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n",
       "      register_renderer(events, OutputArea);\n",
       "    }\n",
       "  }\n",
       "\n",
       "  \n",
       "  if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n",
       "    root._bokeh_timeout = Date.now() + 5000;\n",
       "    root._bokeh_failed_load = false;\n",
       "  }\n",
       "\n",
       "  var NB_LOAD_WARNING = {'data': {'text/html':\n",
       "     \"<div style='background-color: #fdd'>\\n\"+\n",
       "     \"<p>\\n\"+\n",
       "     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
       "     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
       "     \"</p>\\n\"+\n",
       "     \"<ul>\\n\"+\n",
       "     \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
       "     \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
       "     \"</ul>\\n\"+\n",
       "     \"<code>\\n\"+\n",
       "     \"from bokeh.resources import INLINE\\n\"+\n",
       "     \"output_notebook(resources=INLINE)\\n\"+\n",
       "     \"</code>\\n\"+\n",
       "     \"</div>\"}};\n",
       "\n",
       "  function display_loaded() {\n",
       "    var el = document.getElementById(\"1001\");\n",
       "    if (el != null) {\n",
       "      el.textContent = \"BokehJS is loading...\";\n",
       "    }\n",
       "    if (root.Bokeh !== undefined) {\n",
       "      if (el != null) {\n",
       "        el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n",
       "      }\n",
       "    } else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(display_loaded, 100)\n",
       "    }\n",
       "  }\n",
       "\n",
       "\n",
       "  function run_callbacks() {\n",
       "    try {\n",
       "      root._bokeh_onload_callbacks.forEach(function(callback) {\n",
       "        if (callback != null)\n",
       "          callback();\n",
       "      });\n",
       "    } finally {\n",
       "      delete root._bokeh_onload_callbacks\n",
       "    }\n",
       "    console.debug(\"Bokeh: all callbacks have finished\");\n",
       "  }\n",
       "\n",
       "  function load_libs(css_urls, js_urls, callback) {\n",
       "    if (css_urls == null) css_urls = [];\n",
       "    if (js_urls == null) js_urls = [];\n",
       "\n",
       "    root._bokeh_onload_callbacks.push(callback);\n",
       "    if (root._bokeh_is_loading > 0) {\n",
       "      console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
       "      return null;\n",
       "    }\n",
       "    if (js_urls == null || js_urls.length === 0) {\n",
       "      run_callbacks();\n",
       "      return null;\n",
       "    }\n",
       "    console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
       "    root._bokeh_is_loading = css_urls.length + js_urls.length;\n",
       "\n",
       "    function on_load() {\n",
       "      root._bokeh_is_loading--;\n",
       "      if (root._bokeh_is_loading === 0) {\n",
       "        console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n",
       "        run_callbacks()\n",
       "      }\n",
       "    }\n",
       "\n",
       "    function on_error() {\n",
       "      console.error(\"failed to load \" + url);\n",
       "    }\n",
       "\n",
       "    for (var i = 0; i < css_urls.length; i++) {\n",
       "      var url = css_urls[i];\n",
       "      const element = document.createElement(\"link\");\n",
       "      element.onload = on_load;\n",
       "      element.onerror = on_error;\n",
       "      element.rel = \"stylesheet\";\n",
       "      element.type = \"text/css\";\n",
       "      element.href = url;\n",
       "      console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n",
       "      document.body.appendChild(element);\n",
       "    }\n",
       "\n",
       "    const hashes = {\"https://cdn.bokeh.org/bokeh/release/bokeh-2.0.1.min.js\": \"JpP8FXbgAZLkfur7LiK3j9AGBhHNIvF742meBJrjO2ShJDhCG2I1uVvW+0DUtrmc\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.0.1.min.js\": \"xZlADit0Q04ISQEdKg2k3L4W9AwQBAuDs9nJL9fM/WwzL1tEU9VPNezOFX0nLEAz\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.0.1.min.js\": \"4BuPRZkdMKSnj3zoxiNrQ86XgNw0rYmBOxe7nshquXwwcauupgBF2DHLVG1WuZlV\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.0.1.min.js\": \"Dv1SQ87hmDqK6S5OhBf0bCuwAEvL5QYL0PuR/F1SPVhCS/r/abjkbpKDYL2zeM19\"};\n",
       "\n",
       "    for (var i = 0; i < js_urls.length; i++) {\n",
       "      var url = js_urls[i];\n",
       "      var element = document.createElement('script');\n",
       "      element.onload = on_load;\n",
       "      element.onerror = on_error;\n",
       "      element.async = false;\n",
       "      element.src = url;\n",
       "      if (url in hashes) {\n",
       "        element.crossOrigin = \"anonymous\";\n",
       "        element.integrity = \"sha384-\" + hashes[url];\n",
       "      }\n",
       "      console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "      document.head.appendChild(element);\n",
       "    }\n",
       "  };var element = document.getElementById(\"1001\");\n",
       "  if (element == null) {\n",
       "    console.error(\"Bokeh: ERROR: autoload.js configured with elementid '1001' but no matching script tag was found. \")\n",
       "    return false;\n",
       "  }\n",
       "\n",
       "  function inject_raw_css(css) {\n",
       "    const element = document.createElement(\"style\");\n",
       "    element.appendChild(document.createTextNode(css));\n",
       "    document.body.appendChild(element);\n",
       "  }\n",
       "\n",
       "  \n",
       "  var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.0.1.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.0.1.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.0.1.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.0.1.min.js\"];\n",
       "  var css_urls = [];\n",
       "  \n",
       "\n",
       "  var inline_js = [\n",
       "    function(Bokeh) {\n",
       "      Bokeh.set_log_level(\"info\");\n",
       "    },\n",
       "    function(Bokeh) {\n",
       "    \n",
       "    \n",
       "    }\n",
       "  ];\n",
       "\n",
       "  function run_inline_js() {\n",
       "    \n",
       "    if (root.Bokeh !== undefined || force === true) {\n",
       "      \n",
       "    for (var i = 0; i < inline_js.length; i++) {\n",
       "      inline_js[i].call(root, root.Bokeh);\n",
       "    }\n",
       "    if (force === true) {\n",
       "        display_loaded();\n",
       "      }} else if (Date.now() < root._bokeh_timeout) {\n",
       "      setTimeout(run_inline_js, 100);\n",
       "    } else if (!root._bokeh_failed_load) {\n",
       "      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
       "      root._bokeh_failed_load = true;\n",
       "    } else if (force !== true) {\n",
       "      var cell = $(document.getElementById(\"1001\")).parents('.cell').data().cell;\n",
       "      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
       "    }\n",
       "\n",
       "  }\n",
       "\n",
       "  if (root._bokeh_is_loading === 0) {\n",
       "    console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
       "    run_inline_js();\n",
       "  } else {\n",
       "    load_libs(css_urls, js_urls, function() {\n",
       "      console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n",
       "      run_inline_js();\n",
       "    });\n",
       "  }\n",
       "}(window));"
      ],
      "application/vnd.bokehjs_load.v0+json": "\n(function(root) {\n  function now() {\n    return new Date();\n  }\n\n  var force = true;\n\n  if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n    root._bokeh_onload_callbacks = [];\n    root._bokeh_is_loading = undefined;\n  }\n\n  \n\n  \n  if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n    root._bokeh_timeout = Date.now() + 5000;\n    root._bokeh_failed_load = false;\n  }\n\n  var NB_LOAD_WARNING = {'data': {'text/html':\n     \"<div style='background-color: #fdd'>\\n\"+\n     \"<p>\\n\"+\n     \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n     \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n     \"</p>\\n\"+\n     \"<ul>\\n\"+\n     \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n     \"<li>use INLINE resources instead, as so:</li>\\n\"+\n     \"</ul>\\n\"+\n     \"<code>\\n\"+\n     \"from bokeh.resources import INLINE\\n\"+\n     \"output_notebook(resources=INLINE)\\n\"+\n     \"</code>\\n\"+\n     \"</div>\"}};\n\n  function display_loaded() {\n    var el = document.getElementById(\"1001\");\n    if (el != null) {\n      el.textContent = \"BokehJS is loading...\";\n    }\n    if (root.Bokeh !== undefined) {\n      if (el != null) {\n        el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n      }\n    } else if (Date.now() < root._bokeh_timeout) {\n      setTimeout(display_loaded, 100)\n    }\n  }\n\n\n  function run_callbacks() {\n    try {\n      root._bokeh_onload_callbacks.forEach(function(callback) {\n        if (callback != null)\n          callback();\n      });\n    } finally {\n      delete root._bokeh_onload_callbacks\n    }\n    console.debug(\"Bokeh: all callbacks have finished\");\n  }\n\n  function load_libs(css_urls, js_urls, callback) {\n    if (css_urls == null) css_urls = [];\n    if (js_urls == null) js_urls = [];\n\n    root._bokeh_onload_callbacks.push(callback);\n    if (root._bokeh_is_loading > 0) {\n      console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n      return null;\n    }\n    if (js_urls == null || js_urls.length === 0) {\n      run_callbacks();\n      return null;\n    }\n    console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n    root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n    function on_load() {\n      root._bokeh_is_loading--;\n      if (root._bokeh_is_loading === 0) {\n        console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n        run_callbacks()\n      }\n    }\n\n    function on_error() {\n      console.error(\"failed to load \" + url);\n    }\n\n    for (var i = 0; i < css_urls.length; i++) {\n      var url = css_urls[i];\n      const element = document.createElement(\"link\");\n      element.onload = on_load;\n      element.onerror = on_error;\n      element.rel = \"stylesheet\";\n      element.type = \"text/css\";\n      element.href = url;\n      console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n      document.body.appendChild(element);\n    }\n\n    const hashes = {\"https://cdn.bokeh.org/bokeh/release/bokeh-2.0.1.min.js\": \"JpP8FXbgAZLkfur7LiK3j9AGBhHNIvF742meBJrjO2ShJDhCG2I1uVvW+0DUtrmc\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.0.1.min.js\": \"xZlADit0Q04ISQEdKg2k3L4W9AwQBAuDs9nJL9fM/WwzL1tEU9VPNezOFX0nLEAz\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.0.1.min.js\": \"4BuPRZkdMKSnj3zoxiNrQ86XgNw0rYmBOxe7nshquXwwcauupgBF2DHLVG1WuZlV\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.0.1.min.js\": \"Dv1SQ87hmDqK6S5OhBf0bCuwAEvL5QYL0PuR/F1SPVhCS/r/abjkbpKDYL2zeM19\"};\n\n    for (var i = 0; i < js_urls.length; i++) {\n      var url = js_urls[i];\n      var element = document.createElement('script');\n      element.onload = on_load;\n      element.onerror = on_error;\n      element.async = false;\n      element.src = url;\n      if (url in hashes) {\n        element.crossOrigin = \"anonymous\";\n        element.integrity = \"sha384-\" + hashes[url];\n      }\n      console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n      document.head.appendChild(element);\n    }\n  };var element = document.getElementById(\"1001\");\n  if (element == null) {\n    console.error(\"Bokeh: ERROR: autoload.js configured with elementid '1001' but no matching script tag was found. \")\n    return false;\n  }\n\n  function inject_raw_css(css) {\n    const element = document.createElement(\"style\");\n    element.appendChild(document.createTextNode(css));\n    document.body.appendChild(element);\n  }\n\n  \n  var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.0.1.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.0.1.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.0.1.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.0.1.min.js\"];\n  var css_urls = [];\n  \n\n  var inline_js = [\n    function(Bokeh) {\n      Bokeh.set_log_level(\"info\");\n    },\n    function(Bokeh) {\n    \n    \n    }\n  ];\n\n  function run_inline_js() {\n    \n    if (root.Bokeh !== undefined || force === true) {\n      \n    for (var i = 0; i < inline_js.length; i++) {\n      inline_js[i].call(root, root.Bokeh);\n    }\n    if (force === true) {\n        display_loaded();\n      }} else if (Date.now() < root._bokeh_timeout) {\n      setTimeout(run_inline_js, 100);\n    } else if (!root._bokeh_failed_load) {\n      console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n      root._bokeh_failed_load = true;\n    } else if (force !== true) {\n      var cell = $(document.getElementById(\"1001\")).parents('.cell').data().cell;\n      cell.output_area.append_execute_result(NB_LOAD_WARNING)\n    }\n\n  }\n\n  if (root._bokeh_is_loading === 0) {\n    console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n    run_inline_js();\n  } else {\n    load_libs(css_urls, js_urls, function() {\n      console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n      run_inline_js();\n    });\n  }\n}(window));"
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.io import output_notebook, show\n",
    "from bokeh.plotting import figure\n",
    "output_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now that we know from the previous chapter how multiple plots can be placed together in a layout, we can start to look at how different plots can be linked togeher, or how plots can be linked to widgets. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Linked Interactions\n",
    "\n",
    "It is possible to link various interactions between different Bokeh plots. For instance, the ranges of two (or more) plots can be linked, so that when one of the plots is panned (or zoomed, or otherwise has its range changed) the other plots will update in unison. It is also possible to link selections between two plots, so that when items are selected on one plot, the corresponding items on the second plot also become selected. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Linked panning\n",
    "\n",
    "Linked panning (when multiple plots have ranges that stay in sync) is simple to spell with Bokeh. You simply share the appropriate range objects between two (or more) plots. The example below shows how to accomplish this by linking the ranges of three plots in various ways:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"e137da9d-944d-4256-9057-4bdec2e5d7ad\" data-root-id=\"1110\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"7f65f940-d7d8-4600-8fcf-e4b14dbce781\":{\"roots\":{\"references\":[{\"attributes\":{\"children\":[{\"id\":\"1109\"},{\"id\":\"1107\"}]},\"id\":\"1110\",\"type\":\"Column\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1044\"},{\"id\":\"1045\"}]},\"id\":\"1046\",\"type\":\"Toolbar\"},{\"attributes\":{\"data\":{\"x\":[0,1,2,3,4,5,6,7,8,9,10],\"y\":[0,1,2,3,4,5,6,7,8,9,10]},\"selected\":{\"id\":\"1087\"},\"selection_policy\":{\"id\":\"1086\"}},\"id\":\"1024\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1032\",\"type\":\"LinearScale\"},{\"attributes\":{\"formatter\":{\"id\":\"1082\"},\"ticker\":{\"id\":\"1012\"}},\"id\":\"1011\",\"type\":\"LinearAxis\"},{\"attributes\":{\"axis\":{\"id\":\"1011\"},\"ticker\":null},\"id\":\"1014\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1104\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"fill_color\":{\"value\":\"firebrick\"},\"line_color\":{\"value\":\"firebrick\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1050\",\"type\":\"Triangle\"},{\"attributes\":{},\"id\":\"1105\",\"type\":\"Selection\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1098\",\"type\":\"Title\"},{\"attributes\":{\"children\":[[{\"id\":\"1002\"},0,0],[{\"id\":\"1029\"},0,1],[{\"id\":\"1054\"},0,2]]},\"id\":\"1107\",\"type\":\"GridBox\"},{\"attributes\":{\"formatter\":{\"id\":\"1084\"},\"ticker\":{\"id\":\"1016\"}},\"id\":\"1015\",\"type\":\"LinearAxis\"},{\"attributes\":{\"below\":[{\"id\":\"1036\"}],\"center\":[{\"id\":\"1039\"},{\"id\":\"1043\"}],\"left\":[{\"id\":\"1040\"}],\"plot_height\":250,\"plot_width\":250,\"renderers\":[{\"id\":\"1052\"}],\"title\":{\"id\":\"1089\"},\"toolbar\":{\"id\":\"1046\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"1003\"},\"x_scale\":{\"id\":\"1032\"},\"y_range\":{\"id\":\"1005\"},\"y_scale\":{\"id\":\"1034\"}},\"id\":\"1029\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1016\",\"type\":\"BasicTicker\"},{\"attributes\":{\"data\":{\"x\":[0,1,2,3,4,5,6,7,8,9,10],\"y\":[10,9,8,7,6,5,4,3,2,1,0]},\"selected\":{\"id\":\"1096\"},\"selection_policy\":{\"id\":\"1095\"}},\"id\":\"1049\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1037\",\"type\":\"BasicTicker\"},{\"attributes\":{\"axis\":{\"id\":\"1015\"},\"dimension\":1,\"ticker\":null},\"id\":\"1018\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1056\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data_source\":{\"id\":\"1049\"},\"glyph\":{\"id\":\"1050\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1051\"},\"selection_glyph\":null,\"view\":{\"id\":\"1053\"}},\"id\":\"1052\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"navy\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"navy\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1026\",\"type\":\"Circle\"},{\"attributes\":{\"axis\":{\"id\":\"1036\"},\"ticker\":null},\"id\":\"1039\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1091\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"1049\"}},\"id\":\"1053\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1034\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1082\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"formatter\":{\"id\":\"1091\"},\"ticker\":{\"id\":\"1037\"}},\"id\":\"1036\",\"type\":\"LinearAxis\"},{\"attributes\":{\"toolbars\":[{\"id\":\"1021\"},{\"id\":\"1046\"},{\"id\":\"1072\"}],\"tools\":[{\"id\":\"1019\"},{\"id\":\"1020\"},{\"id\":\"1044\"},{\"id\":\"1045\"},{\"id\":\"1070\"},{\"id\":\"1071\"}]},\"id\":\"1108\",\"type\":\"ProxyToolbar\"},{\"attributes\":{},\"id\":\"1044\",\"type\":\"PanTool\"},{\"attributes\":{\"formatter\":{\"id\":\"1100\"},\"ticker\":{\"id\":\"1063\"}},\"id\":\"1062\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1093\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1019\",\"type\":\"PanTool\"},{\"attributes\":{\"formatter\":{\"id\":\"1093\"},\"ticker\":{\"id\":\"1041\"}},\"id\":\"1040\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1020\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"1060\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1041\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1058\",\"type\":\"LinearScale\"},{\"attributes\":{\"axis\":{\"id\":\"1040\"},\"dimension\":1,\"ticker\":null},\"id\":\"1043\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1070\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"1063\",\"type\":\"BasicTicker\"},{\"attributes\":{\"axis\":{\"id\":\"1062\"},\"ticker\":null},\"id\":\"1065\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"firebrick\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"firebrick\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1051\",\"type\":\"Triangle\"},{\"attributes\":{},\"id\":\"1045\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"formatter\":{\"id\":\"1102\"},\"ticker\":{\"id\":\"1067\"}},\"id\":\"1066\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1100\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1067\",\"type\":\"BasicTicker\"},{\"attributes\":{\"axis\":{\"id\":\"1066\"},\"dimension\":1,\"ticker\":null},\"id\":\"1069\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1102\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1084\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1086\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1087\",\"type\":\"Selection\"},{\"attributes\":{\"fill_color\":{\"value\":\"olive\"},\"line_color\":{\"value\":\"olive\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1076\",\"type\":\"Square\"},{\"attributes\":{},\"id\":\"1071\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"toolbar\":{\"id\":\"1108\"},\"toolbar_location\":\"above\"},\"id\":\"1109\",\"type\":\"ToolbarBox\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1070\"},{\"id\":\"1071\"}]},\"id\":\"1072\",\"type\":\"Toolbar\"},{\"attributes\":{\"data_source\":{\"id\":\"1024\"},\"glyph\":{\"id\":\"1025\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1026\"},\"selection_glyph\":null,\"view\":{\"id\":\"1028\"}},\"id\":\"1027\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"1075\"}},\"id\":\"1079\",\"type\":\"CDSView\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1080\",\"type\":\"Title\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1019\"},{\"id\":\"1020\"}]},\"id\":\"1021\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1003\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1095\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1096\",\"type\":\"Selection\"},{\"attributes\":{\"below\":[{\"id\":\"1011\"}],\"center\":[{\"id\":\"1014\"},{\"id\":\"1018\"}],\"left\":[{\"id\":\"1015\"}],\"plot_height\":250,\"plot_width\":250,\"renderers\":[{\"id\":\"1027\"}],\"title\":{\"id\":\"1080\"},\"toolbar\":{\"id\":\"1021\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"1003\"},\"x_scale\":{\"id\":\"1007\"},\"y_range\":{\"id\":\"1005\"},\"y_scale\":{\"id\":\"1009\"}},\"id\":\"1002\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"data_source\":{\"id\":\"1075\"},\"glyph\":{\"id\":\"1076\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1077\"},\"selection_glyph\":null,\"view\":{\"id\":\"1079\"}},\"id\":\"1078\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_color\":{\"value\":\"navy\"},\"line_color\":{\"value\":\"navy\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1025\",\"type\":\"Circle\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"olive\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"olive\"},\"size\":{\"units\":\"screen\",\"value\":10},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1077\",\"type\":\"Square\"},{\"attributes\":{\"below\":[{\"id\":\"1062\"}],\"center\":[{\"id\":\"1065\"},{\"id\":\"1069\"}],\"left\":[{\"id\":\"1066\"}],\"plot_height\":250,\"plot_width\":250,\"renderers\":[{\"id\":\"1078\"}],\"title\":{\"id\":\"1098\"},\"toolbar\":{\"id\":\"1072\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"1003\"},\"x_scale\":{\"id\":\"1058\"},\"y_range\":{\"id\":\"1056\"},\"y_scale\":{\"id\":\"1060\"}},\"id\":\"1054\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1089\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1005\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data\":{\"x\":[0,1,2,3,4,5,6,7,8,9,10],\"y\":[5,4,3,2,1,0,1,2,3,4,5]},\"selected\":{\"id\":\"1105\"},\"selection_policy\":{\"id\":\"1104\"}},\"id\":\"1075\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1007\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1009\",\"type\":\"LinearScale\"},{\"attributes\":{\"source\":{\"id\":\"1024\"}},\"id\":\"1028\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1012\",\"type\":\"BasicTicker\"}],\"root_ids\":[\"1110\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.1\"}};\n",
       "  var render_items = [{\"docid\":\"7f65f940-d7d8-4600-8fcf-e4b14dbce781\",\"root_ids\":[\"1110\"],\"roots\":{\"1110\":\"e137da9d-944d-4256-9057-4bdec2e5d7ad\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "1110"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.layouts import gridplot\n",
    "\n",
    "x = list(range(11))\n",
    "y0, y1, y2 = x, [10-i for i in x], [abs(i-5) for i in x]\n",
    "\n",
    "plot_options = dict(width=250, plot_height=250, tools='pan,wheel_zoom')\n",
    "\n",
    "# create a new plot\n",
    "s1 = figure(**plot_options)\n",
    "s1.circle(x, y0, size=10, color=\"navy\")\n",
    "\n",
    "# create a new plot and share both ranges\n",
    "s2 = figure(x_range=s1.x_range, y_range=s1.y_range, **plot_options)\n",
    "s2.triangle(x, y1, size=10, color=\"firebrick\")\n",
    "\n",
    "# create a new plot and share only one range\n",
    "s3 = figure(x_range=s1.x_range, **plot_options)\n",
    "s3.square(x, y2, size=10, color=\"olive\")\n",
    "\n",
    "p = gridplot([[s1, s2, s3]])\n",
    "\n",
    "# show the results\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# EXERCISE: create two plots in a gridplot, and link their ranges\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Linked brushing\n",
    "\n",
    "Linking selections is accomplished in a similar way, by sharing data sources between plots. Note that normally with ``bokeh.plotting`` and ``bokeh.charts`` creating a default data source for simple plots is handled automatically. However to share a data source, we must create them by hand and pass them explicitly. This is illustrated in the example below:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"4005a1c3-d92e-4849-9a22-cd23056a871c\" data-root-id=\"1367\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"e7091d01-d89f-4f0d-8dbe-a9128d27563e\":{\"roots\":{\"references\":[{\"attributes\":{\"children\":[{\"id\":\"1366\"},{\"id\":\"1364\"}]},\"id\":\"1367\",\"type\":\"Column\"},{\"attributes\":{},\"id\":\"1290\",\"type\":\"BasicTicker\"},{\"attributes\":{\"formatter\":{\"id\":\"1346\"},\"ticker\":{\"id\":\"1294\"}},\"id\":\"1293\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1312\",\"type\":\"DataRange1d\"},{\"attributes\":{\"overlay\":{\"id\":\"1300\"}},\"id\":\"1297\",\"type\":\"BoxSelectTool\"},{\"attributes\":{},\"id\":\"1330\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"1294\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1316\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1344\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"axis\":{\"id\":\"1289\"},\"ticker\":null},\"id\":\"1292\",\"type\":\"Grid\"},{\"attributes\":{\"axis\":{\"id\":\"1293\"},\"dimension\":1,\"ticker\":null},\"id\":\"1296\",\"type\":\"Grid\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1331\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"1299\",\"type\":\"HelpTool\"},{\"attributes\":{\"below\":[{\"id\":\"1289\"}],\"center\":[{\"id\":\"1292\"},{\"id\":\"1296\"}],\"left\":[{\"id\":\"1293\"}],\"plot_height\":300,\"plot_width\":300,\"renderers\":[{\"id\":\"1309\"}],\"title\":{\"id\":\"1342\"},\"toolbar\":{\"id\":\"1302\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"1281\"},\"x_scale\":{\"id\":\"1285\"},\"y_range\":{\"id\":\"1283\"},\"y_scale\":{\"id\":\"1287\"}},\"id\":\"1280\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1297\"},{\"id\":\"1298\"},{\"id\":\"1299\"}]},\"id\":\"1302\",\"type\":\"Toolbar\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y1\"}},\"id\":\"1338\",\"type\":\"Circle\"},{\"attributes\":{\"overlay\":{\"id\":\"1301\"}},\"id\":\"1298\",\"type\":\"LassoSelectTool\"},{\"attributes\":{},\"id\":\"1346\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1353\",\"type\":\"Title\"},{\"attributes\":{\"formatter\":{\"id\":\"1355\"},\"ticker\":{\"id\":\"1321\"}},\"id\":\"1320\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1314\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"xs_units\":\"screen\",\"ys_units\":\"screen\"},\"id\":\"1332\",\"type\":\"PolyAnnotation\"},{\"attributes\":{},\"id\":\"1318\",\"type\":\"LinearScale\"},{\"attributes\":{\"overlay\":{\"id\":\"1331\"}},\"id\":\"1328\",\"type\":\"BoxSelectTool\"},{\"attributes\":{},\"id\":\"1321\",\"type\":\"BasicTicker\"},{\"attributes\":{\"data_source\":{\"id\":\"1279\"},\"glyph\":{\"id\":\"1338\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1339\"},\"selection_glyph\":null,\"view\":{\"id\":\"1341\"}},\"id\":\"1340\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis\":{\"id\":\"1320\"},\"ticker\":null},\"id\":\"1323\",\"type\":\"Grid\"},{\"attributes\":{\"source\":{\"id\":\"1279\"}},\"id\":\"1341\",\"type\":\"CDSView\"},{\"attributes\":{\"formatter\":{\"id\":\"1357\"},\"ticker\":{\"id\":\"1325\"}},\"id\":\"1324\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1325\",\"type\":\"BasicTicker\"},{\"attributes\":{\"axis\":{\"id\":\"1324\"},\"dimension\":1,\"ticker\":null},\"id\":\"1327\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y1\"}},\"id\":\"1339\",\"type\":\"Circle\"},{\"attributes\":{\"overlay\":{\"id\":\"1332\"}},\"id\":\"1329\",\"type\":\"LassoSelectTool\"},{\"attributes\":{},\"id\":\"1355\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1328\"},{\"id\":\"1329\"},{\"id\":\"1330\"}]},\"id\":\"1333\",\"type\":\"Toolbar\"},{\"attributes\":{\"toolbars\":[{\"id\":\"1302\"},{\"id\":\"1333\"}],\"tools\":[{\"id\":\"1297\"},{\"id\":\"1298\"},{\"id\":\"1299\"},{\"id\":\"1328\"},{\"id\":\"1329\"},{\"id\":\"1330\"}]},\"id\":\"1365\",\"type\":\"ProxyToolbar\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1342\",\"type\":\"Title\"},{\"attributes\":{\"toolbar\":{\"id\":\"1365\"},\"toolbar_location\":\"above\"},\"id\":\"1366\",\"type\":\"ToolbarBox\"},{\"attributes\":{},\"id\":\"1357\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1300\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"data\":{\"x\":[-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],\"y0\":[20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],\"y1\":[400,361,324,289,256,225,196,169,144,121,100,81,64,49,36,25,16,9,4,1,0,1,4,9,16,25,36,49,64,81,100,121,144,169,196,225,256,289,324,361,400]},\"selected\":{\"id\":\"1351\"},\"selection_policy\":{\"id\":\"1350\"}},\"id\":\"1279\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1281\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1350\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1287\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1351\",\"type\":\"Selection\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y0\"}},\"id\":\"1307\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1283\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1285\",\"type\":\"LinearScale\"},{\"attributes\":{\"formatter\":{\"id\":\"1344\"},\"ticker\":{\"id\":\"1290\"}},\"id\":\"1289\",\"type\":\"LinearAxis\"},{\"attributes\":{\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"xs_units\":\"screen\",\"ys_units\":\"screen\"},\"id\":\"1301\",\"type\":\"PolyAnnotation\"},{\"attributes\":{\"data_source\":{\"id\":\"1279\"},\"glyph\":{\"id\":\"1307\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1308\"},\"selection_glyph\":null,\"view\":{\"id\":\"1310\"}},\"id\":\"1309\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"children\":[[{\"id\":\"1280\"},0,0],[{\"id\":\"1311\"},0,1]]},\"id\":\"1364\",\"type\":\"GridBox\"},{\"attributes\":{\"source\":{\"id\":\"1279\"}},\"id\":\"1310\",\"type\":\"CDSView\"},{\"attributes\":{\"below\":[{\"id\":\"1320\"}],\"center\":[{\"id\":\"1323\"},{\"id\":\"1327\"}],\"left\":[{\"id\":\"1324\"}],\"plot_height\":300,\"plot_width\":300,\"renderers\":[{\"id\":\"1340\"}],\"title\":{\"id\":\"1353\"},\"toolbar\":{\"id\":\"1333\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"1312\"},\"x_scale\":{\"id\":\"1316\"},\"y_range\":{\"id\":\"1314\"},\"y_scale\":{\"id\":\"1318\"}},\"id\":\"1311\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y0\"}},\"id\":\"1308\",\"type\":\"Circle\"}],\"root_ids\":[\"1367\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.1\"}};\n",
       "  var render_items = [{\"docid\":\"e7091d01-d89f-4f0d-8dbe-a9128d27563e\",\"root_ids\":[\"1367\"],\"roots\":{\"1367\":\"4005a1c3-d92e-4849-9a22-cd23056a871c\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "1367"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.models import ColumnDataSource\n",
    "\n",
    "x = list(range(-20, 21))\n",
    "y0, y1 = [abs(xx) for xx in x], [xx**2 for xx in x]\n",
    "\n",
    "# create a column data source for the plots to share\n",
    "source = ColumnDataSource(data=dict(x=x, y0=y0, y1=y1))\n",
    "\n",
    "TOOLS = \"box_select,lasso_select,help\"\n",
    "\n",
    "# create a new plot and add a renderer\n",
    "left = figure(tools=TOOLS, width=300, height=300)\n",
    "left.circle('x', 'y0', source=source)\n",
    "\n",
    "# create another new plot and add a renderer\n",
    "right = figure(tools=TOOLS, width=300, height=300)\n",
    "right.circle('x', 'y1', source=source)\n",
    "\n",
    "p = gridplot([[left, right]])\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "# EXERCISE: create two plots in a gridplot, and link their data sources\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Hover Tools\n",
    "\n",
    "Bokeh has a Hover Tool that allows additional information to be displayed in a popup whenever the user hovers over a specific glyph. Basic hover tool configuration amounts to providing a list of ``(name, format)`` tuples. The full details can be found in the User's Guide [here](https://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#hovertool).\n",
    "\n",
    "The example below shows some basic usage of the Hover tool with a circle glyph, using hover information defined in utils.py:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"325ab0a7-1f04-497b-8a17-5bfc63027a8b\" data-root-id=\"1522\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"40c7ed13-851c-4aed-8341-3beecb5644ad\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1533\"}],\"center\":[{\"id\":\"1536\"},{\"id\":\"1540\"}],\"left\":[{\"id\":\"1537\"}],\"plot_height\":300,\"plot_width\":300,\"renderers\":[{\"id\":\"1546\"}],\"title\":{\"id\":\"1523\"},\"toolbar\":{\"id\":\"1541\"},\"x_range\":{\"id\":\"1525\"},\"x_scale\":{\"id\":\"1529\"},\"y_range\":{\"id\":\"1527\"},\"y_scale\":{\"id\":\"1531\"}},\"id\":\"1522\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"source\":{\"id\":\"1520\"}},\"id\":\"1547\",\"type\":\"CDSView\"},{\"attributes\":{\"axis\":{\"id\":\"1533\"},\"ticker\":null},\"id\":\"1536\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"1593\"},\"ticker\":{\"id\":\"1538\"}},\"id\":\"1537\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1538\",\"type\":\"BasicTicker\"},{\"attributes\":{\"axis\":{\"id\":\"1537\"},\"dimension\":1,\"ticker\":null},\"id\":\"1540\",\"type\":\"Grid\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1521\"}]},\"id\":\"1541\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1593\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"tooltips\":[[\"index\",\"$index\"],[\"(x,y)\",\"($x, $y)\"],[\"desc\",\"@desc\"]]},\"id\":\"1521\",\"type\":\"HoverTool\"},{\"attributes\":{},\"id\":\"1531\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1591\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"formatter\":{\"id\":\"1591\"},\"ticker\":{\"id\":\"1534\"}},\"id\":\"1533\",\"type\":\"LinearAxis\"},{\"attributes\":{\"data\":{\"desc\":[\"A\",\"b\",\"C\",\"d\",\"E\"],\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]},\"selected\":{\"id\":\"1596\"},\"selection_policy\":{\"id\":\"1595\"}},\"id\":\"1520\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1534\",\"type\":\"BasicTicker\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1545\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1595\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"text\":\"Mouse over the dots\"},\"id\":\"1523\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1596\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"1520\"},\"glyph\":{\"id\":\"1544\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1545\"},\"selection_glyph\":null,\"view\":{\"id\":\"1547\"}},\"id\":\"1546\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1527\",\"type\":\"DataRange1d\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1544\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1525\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1529\",\"type\":\"LinearScale\"}],\"root_ids\":[\"1522\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.1\"}};\n",
       "  var render_items = [{\"docid\":\"40c7ed13-851c-4aed-8341-3beecb5644ad\",\"root_ids\":[\"1522\"],\"roots\":{\"1522\":\"325ab0a7-1f04-497b-8a17-5bfc63027a8b\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "1522"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.models import HoverTool\n",
    "\n",
    "source = ColumnDataSource(\n",
    "        data=dict(\n",
    "            x=[1, 2, 3, 4, 5],\n",
    "            y=[2, 5, 8, 2, 7],\n",
    "            desc=['A', 'b', 'C', 'd', 'E'],\n",
    "        )\n",
    "    )\n",
    "\n",
    "hover = HoverTool(\n",
    "        tooltips=[\n",
    "            (\"index\", \"$index\"),\n",
    "            (\"(x,y)\", \"($x, $y)\"),\n",
    "            (\"desc\", \"@desc\"),\n",
    "        ]\n",
    "    )\n",
    "\n",
    "p = figure(plot_width=300, plot_height=300, tools=[hover], title=\"Mouse over the dots\")\n",
    "\n",
    "p.circle('x', 'y', size=20, source=source)\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Widgets"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Bokeh supports direct integration with a small basic widget set. These can be used in conjunction with a Bokeh Server, or with ``CustomJS`` models to add more interactive capability to your documents. You can see a complete list, with example code in the [Adding Widgets](https://bokeh.pydata.org/en/latest/docs/user_guide/interaction.html#adding-widgets) section of the User's Guide. \n",
    "\n",
    "\n",
    "\n",
    "*NOTE: In this Tutorial chapter, we will focus on using widgets with JavaScript callbacks. The Tutorial chapter on Bokeh server applications covers using Bokeh widgets with real Python callbacks*\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "To use the widgets, include them in a layout like you would a plot object:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"258495c3-040a-4f53-9609-5b2cd93e3def\" data-root-id=\"1639\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"23208dd1-32cd-4771-b043-e8b266a2643d\":{\"roots\":{\"references\":[{\"attributes\":{\"end\":10,\"format\":\"0[.]00\",\"start\":0,\"step\":0.1,\"title\":\"foo\",\"value\":1},\"id\":\"1639\",\"type\":\"Slider\"}],\"root_ids\":[\"1639\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.1\"}};\n",
       "  var render_items = [{\"docid\":\"23208dd1-32cd-4771-b043-e8b266a2643d\",\"root_ids\":[\"1639\"],\"roots\":{\"1639\":\"258495c3-040a-4f53-9609-5b2cd93e3def\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "1639"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.models.widgets import Slider\n",
    "\n",
    "\n",
    "slider = Slider(start=0, end=10, value=1, step=.1, title=\"foo\")\n",
    "\n",
    "show(slider)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "# EXERCISE: create and show a Select widget \n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# CustomJS Callbacks\n",
    "\n",
    "In order for a widget to be useful, it needs to be able to perform some action. Using the Bokeh server, it is possible to have widgets trigger real Python code. That possibility will be explored in the Bokeh server chapter of the turorial. Here, we look at how widgets can be configured with `CustomJS` callbacks that execute snippets of JavaScript code. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"518c4467-0330-432b-87f0-27804a98aef0\" data-root-id=\"1691\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"26e1a425-8362-4e84-82dc-f0f092f06571\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1700\"}],\"center\":[{\"id\":\"1703\"},{\"id\":\"1707\"}],\"left\":[{\"id\":\"1704\"}],\"plot_height\":300,\"renderers\":[{\"id\":\"1713\"}],\"title\":{\"id\":\"1764\"},\"toolbar\":{\"id\":\"1708\"},\"x_range\":{\"id\":\"1692\"},\"x_scale\":{\"id\":\"1696\"},\"y_range\":{\"id\":\"1694\"},\"y_scale\":{\"id\":\"1698\"}},\"id\":\"1691\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1696\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1694\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1701\",\"type\":\"BasicTicker\"},{\"attributes\":{\"axis\":{\"id\":\"1700\"},\"ticker\":null},\"id\":\"1703\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":{\"id\":\"1689\"}},\"id\":\"1690\",\"type\":\"TapTool\"},{\"attributes\":{\"axis\":{\"id\":\"1704\"},\"dimension\":1,\"ticker\":null},\"id\":\"1707\",\"type\":\"Grid\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1690\"}]},\"id\":\"1708\",\"type\":\"Toolbar\"},{\"attributes\":{\"data_source\":{\"id\":\"1710\"},\"glyph\":{\"id\":\"1711\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1712\"},\"selection_glyph\":null,\"view\":{\"id\":\"1714\"}},\"id\":\"1713\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1712\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1770\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1768\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"code\":\"alert('you tapped a circle!')\"},\"id\":\"1689\",\"type\":\"CustomJS\"},{\"attributes\":{},\"id\":\"1705\",\"type\":\"BasicTicker\"},{\"attributes\":{\"formatter\":{\"id\":\"1768\"},\"ticker\":{\"id\":\"1705\"}},\"id\":\"1704\",\"type\":\"LinearAxis\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"units\":\"screen\",\"value\":20},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1711\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1698\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1766\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1692\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"1710\"}},\"id\":\"1714\",\"type\":\"CDSView\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1764\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1771\",\"type\":\"Selection\"},{\"attributes\":{\"formatter\":{\"id\":\"1766\"},\"ticker\":{\"id\":\"1701\"}},\"id\":\"1700\",\"type\":\"LinearAxis\"},{\"attributes\":{\"data\":{\"x\":[1,2,3,4,5],\"y\":[2,5,8,2,7]},\"selected\":{\"id\":\"1771\"},\"selection_policy\":{\"id\":\"1770\"}},\"id\":\"1710\",\"type\":\"ColumnDataSource\"}],\"root_ids\":[\"1691\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.1\"}};\n",
       "  var render_items = [{\"docid\":\"26e1a425-8362-4e84-82dc-f0f092f06571\",\"root_ids\":[\"1691\"],\"roots\":{\"1691\":\"518c4467-0330-432b-87f0-27804a98aef0\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "1691"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.models import TapTool, CustomJS, ColumnDataSource\n",
    "\n",
    "callback = CustomJS(code=\"alert('you tapped a circle!')\")\n",
    "tap = TapTool(callback=callback)\n",
    "\n",
    "p = figure(plot_width=600, plot_height=300, tools=[tap])\n",
    "\n",
    "p.circle(x=[1, 2, 3, 4, 5], y=[2, 5, 8, 2, 7], size=20)\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## CustomJS for Property changes\n",
    "\n",
    "Bokeh objects that have values associated can have small JavaScript actions attached to them using the `js_on_change` method. These actions (also referred to as \"callbacks\") are executed whenever the widget's value is changed. In order to make it easier to refer to specific Bokeh models (e.g., a data source, or a glyhph) from JavaScript, the ``CustomJS`` obejct also accepts a dictionary of \"args\" that map names to Python Bokeh models. The corresponding JavaScript models are made available automaticaly to the ``CustomJS`` code:\n",
    "\n",
    "```python\n",
    "CustomJS(args=dict(source=source, slider=slider), code=\"\"\"\n",
    "    // easily refer to BokehJS source and slider objects in this JS code\n",
    "    var data = source.data;\n",
    "    var f = slider.value;\n",
    "\"\"\")\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Slider widget example\n",
    "\n",
    "The example below shows an action attached to a slider that updates a data source whenever the slider is moved.  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"79471667-1042-4a22-b131-c3d4e903e964\" data-root-id=\"1859\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"a37fe8fe-bb93-4eb4-a3d1-08cb8bdf6d83\":{\"roots\":{\"references\":[{\"attributes\":{\"children\":[{\"id\":\"1857\"},{\"id\":\"1821\"}]},\"id\":\"1859\",\"type\":\"Column\"},{\"attributes\":{},\"id\":\"1838\",\"type\":\"PanTool\"},{\"attributes\":{\"axis\":{\"id\":\"1830\"},\"ticker\":null},\"id\":\"1833\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"1921\"},\"ticker\":{\"id\":\"1835\"}},\"id\":\"1834\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1835\",\"type\":\"BasicTicker\"},{\"attributes\":{\"axis\":{\"id\":\"1834\"},\"dimension\":1,\"ticker\":null},\"id\":\"1837\",\"type\":\"Grid\"},{\"attributes\":{\"args\":{\"slider\":{\"id\":\"1857\"},\"source\":{\"id\":\"1820\"}},\"code\":\"\\n    var data = source.data;\\n    var f = slider.value;\\n    var x = data['x']\\n    var y = data['y']\\n    for (var i = 0; i < x.length; i++) {\\n        y[i] = Math.pow(x[i], f)\\n    }\\n    \\n    // necessary becasue we mutated source.data in-place\\n    source.change.emit();\\n\"},\"id\":\"1858\",\"type\":\"CustomJS\"},{\"attributes\":{},\"id\":\"1839\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"1843\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"1923\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1841\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1924\",\"type\":\"Selection\"},{\"attributes\":{\"overlay\":{\"id\":\"1844\"}},\"id\":\"1840\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"line_alpha\":0.6,\"line_color\":\"#1f77b4\",\"line_width\":3,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1853\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1842\",\"type\":\"ResetTool\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1917\",\"type\":\"Title\"},{\"attributes\":{\"end\":6,\"format\":\"0[.]00\",\"js_property_callbacks\":{\"change:value\":[{\"id\":\"1858\"}]},\"start\":0.1,\"step\":0.1,\"title\":\"power\",\"value\":1},\"id\":\"1857\",\"type\":\"Slider\"},{\"attributes\":{},\"id\":\"1921\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"#1f77b4\",\"line_width\":3,\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1854\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1831\",\"type\":\"BasicTicker\"},{\"attributes\":{\"data\":{\"x\":[0.0,0.005,0.01,0.015,0.02,0.025,0.03,0.035,0.04,0.045,0.05,0.055,0.06,0.065,0.07,0.075,0.08,0.085,0.09,0.095,0.1,0.105,0.11,0.115,0.12,0.125,0.13,0.135,0.14,0.145,0.15,0.155,0.16,0.165,0.17,0.17500000000000002,0.18,0.185,0.19,0.195,0.2,0.20500000000000002,0.21,0.215,0.22,0.225,0.23,0.23500000000000001,0.24,0.245,0.25,0.255,0.26,0.265,0.27,0.275,0.28,0.28500000000000003,0.29,0.295,0.3,0.305,0.31,0.315,0.32,0.325,0.33,0.335,0.34,0.34500000000000003,0.35000000000000003,0.355,0.36,0.365,0.37,0.375,0.38,0.385,0.39,0.395,0.4,0.405,0.41000000000000003,0.41500000000000004,0.42,0.425,0.43,0.435,0.44,0.445,0.45,0.455,0.46,0.465,0.47000000000000003,0.47500000000000003,0.48,0.485,0.49,0.495,0.5,0.505,0.51,0.515,0.52,0.525,0.53,0.535,0.54,0.545,0.55,0.555,0.56,0.5650000000000001,0.5700000000000001,0.5750000000000001,0.58,0.585,0.59,0.595,0.6,0.605,0.61,0.615,0.62,0.625,0.63,0.635,0.64,0.645,0.65,0.655,0.66,0.665,0.67,0.675,0.68,0.685,0.6900000000000001,0.6950000000000001,0.7000000000000001,0.705,0.71,0.715,0.72,0.725,0.73,0.735,0.74,0.745,0.75,0.755,0.76,0.765,0.77,0.775,0.78,0.785,0.79,0.795,0.8,0.805,0.81,0.8150000000000001,0.8200000000000001,0.8250000000000001,0.8300000000000001,0.835,0.84,0.845,0.85,0.855,0.86,0.865,0.87,0.875,0.88,0.885,0.89,0.895,0.9,0.905,0.91,0.915,0.92,0.925,0.93,0.935,0.9400000000000001,0.9450000000000001,0.9500000000000001,0.9550000000000001,0.96,0.965,0.97,0.975,0.98,0.985,0.99,0.995,1.0],\"y\":[0.0,0.005,0.01,0.015,0.02,0.025,0.03,0.035,0.04,0.045,0.05,0.055,0.06,0.065,0.07,0.075,0.08,0.085,0.09,0.095,0.1,0.105,0.11,0.115,0.12,0.125,0.13,0.135,0.14,0.145,0.15,0.155,0.16,0.165,0.17,0.17500000000000002,0.18,0.185,0.19,0.195,0.2,0.20500000000000002,0.21,0.215,0.22,0.225,0.23,0.23500000000000001,0.24,0.245,0.25,0.255,0.26,0.265,0.27,0.275,0.28,0.28500000000000003,0.29,0.295,0.3,0.305,0.31,0.315,0.32,0.325,0.33,0.335,0.34,0.34500000000000003,0.35000000000000003,0.355,0.36,0.365,0.37,0.375,0.38,0.385,0.39,0.395,0.4,0.405,0.41000000000000003,0.41500000000000004,0.42,0.425,0.43,0.435,0.44,0.445,0.45,0.455,0.46,0.465,0.47000000000000003,0.47500000000000003,0.48,0.485,0.49,0.495,0.5,0.505,0.51,0.515,0.52,0.525,0.53,0.535,0.54,0.545,0.55,0.555,0.56,0.5650000000000001,0.5700000000000001,0.5750000000000001,0.58,0.585,0.59,0.595,0.6,0.605,0.61,0.615,0.62,0.625,0.63,0.635,0.64,0.645,0.65,0.655,0.66,0.665,0.67,0.675,0.68,0.685,0.6900000000000001,0.6950000000000001,0.7000000000000001,0.705,0.71,0.715,0.72,0.725,0.73,0.735,0.74,0.745,0.75,0.755,0.76,0.765,0.77,0.775,0.78,0.785,0.79,0.795,0.8,0.805,0.81,0.8150000000000001,0.8200000000000001,0.8250000000000001,0.8300000000000001,0.835,0.84,0.845,0.85,0.855,0.86,0.865,0.87,0.875,0.88,0.885,0.89,0.895,0.9,0.905,0.91,0.915,0.92,0.925,0.93,0.935,0.9400000000000001,0.9450000000000001,0.9500000000000001,0.9550000000000001,0.96,0.965,0.97,0.975,0.98,0.985,0.99,0.995,1.0]},\"selected\":{\"id\":\"1924\"},\"selection_policy\":{\"id\":\"1923\"}},\"id\":\"1820\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"1820\"},\"glyph\":{\"id\":\"1853\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1854\"},\"selection_glyph\":null,\"view\":{\"id\":\"1856\"}},\"id\":\"1855\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"below\":[{\"id\":\"1830\"}],\"center\":[{\"id\":\"1833\"},{\"id\":\"1837\"}],\"left\":[{\"id\":\"1834\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"1855\"}],\"title\":{\"id\":\"1917\"},\"toolbar\":{\"id\":\"1845\"},\"x_range\":{\"id\":\"1822\"},\"x_scale\":{\"id\":\"1826\"},\"y_range\":{\"id\":\"1824\"},\"y_scale\":{\"id\":\"1828\"}},\"id\":\"1821\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1919\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1838\"},{\"id\":\"1839\"},{\"id\":\"1840\"},{\"id\":\"1841\"},{\"id\":\"1842\"},{\"id\":\"1843\"}]},\"id\":\"1845\",\"type\":\"Toolbar\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1844\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"source\":{\"id\":\"1820\"}},\"id\":\"1856\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1826\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1822\",\"type\":\"DataRange1d\"},{\"attributes\":{\"formatter\":{\"id\":\"1919\"},\"ticker\":{\"id\":\"1831\"}},\"id\":\"1830\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1824\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1828\",\"type\":\"LinearScale\"}],\"root_ids\":[\"1859\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.1\"}};\n",
       "  var render_items = [{\"docid\":\"a37fe8fe-bb93-4eb4-a3d1-08cb8bdf6d83\",\"root_ids\":[\"1859\"],\"roots\":{\"1859\":\"79471667-1042-4a22-b131-c3d4e903e964\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "1859"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.layouts import column\n",
    "from bokeh.models import CustomJS, ColumnDataSource, Slider\n",
    "\n",
    "x = [x*0.005 for x in range(0, 201)]\n",
    "\n",
    "source = ColumnDataSource(data=dict(x=x, y=x))\n",
    "\n",
    "plot = figure(plot_width=400, plot_height=400)\n",
    "plot.line('x', 'y', source=source, line_width=3, line_alpha=0.6)\n",
    "\n",
    "slider = Slider(start=0.1, end=6, value=1, step=.1, title=\"power\")\n",
    "\n",
    "update_curve = CustomJS(args=dict(source=source, slider=slider), code=\"\"\"\n",
    "    var data = source.data;\n",
    "    var f = slider.value;\n",
    "    var x = data['x']\n",
    "    var y = data['y']\n",
    "    for (var i = 0; i < x.length; i++) {\n",
    "        y[i] = Math.pow(x[i], f)\n",
    "    }\n",
    "    \n",
    "    // necessary becasue we mutated source.data in-place\n",
    "    source.change.emit();\n",
    "\"\"\")\n",
    "slider.js_on_change('value', update_curve)\n",
    "\n",
    "\n",
    "show(column(slider, plot))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Exercise: Create a plot that updates based on a Select widget\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Data selection example\n",
    "\n",
    "It's also possible to make JavaScript actions that execute whenever a user selection (e.g., box, point, lasso) changes. This is done by attaching the same kind of CustomJS object to whatever data source the selection is made on.\n",
    "\n",
    "The example below is a bit more sophisticated, and demonstrates updating one glyph's data source in response to another glyph's selection: "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"35b6ed41-fc93-4a8f-a500-8dc7fbc96f40\" data-root-id=\"1981\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"28be63aa-fb84-431b-9b9b-8057f45ac74b\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1992\"}],\"center\":[{\"id\":\"1995\"},{\"id\":\"1999\"}],\"left\":[{\"id\":\"1996\"}],\"plot_height\":400,\"plot_width\":400,\"renderers\":[{\"id\":\"2008\"},{\"id\":\"2014\"}],\"title\":{\"id\":\"1982\"},\"toolbar\":{\"id\":\"2002\"},\"x_range\":{\"id\":\"1984\"},\"x_scale\":{\"id\":\"1988\"},\"y_range\":{\"id\":\"1986\"},\"y_scale\":{\"id\":\"1990\"}},\"id\":\"1981\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"2090\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"xs_units\":\"screen\",\"ys_units\":\"screen\"},\"id\":\"2001\",\"type\":\"PolyAnnotation\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.4},\"fill_color\":{\"field\":\"color\"},\"line_alpha\":{\"value\":0.4},\"line_color\":{\"field\":\"color\"},\"size\":{\"units\":\"screen\",\"value\":8},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2005\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2085\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data\":{\"xm\":[0,1],\"ym\":[0.5,0.5]},\"selected\":{\"id\":\"2093\"},\"selection_policy\":{\"id\":\"2092\"}},\"id\":\"2010\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2092\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2093\",\"type\":\"Selection\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2000\"}]},\"id\":\"2002\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1986\",\"type\":\"DataRange1d\"},{\"attributes\":{\"args\":{\"s1\":{\"id\":\"1980\"},\"s2\":{\"id\":\"2010\"}},\"code\":\"\\n    var inds = s1.selected.indices;\\n    if (inds.length == 0)\\n        return;\\n\\n    var ym = 0\\n    for (var i = 0; i < inds.length; i++) {\\n        ym += s1.data.y[inds[i]]\\n    }\\n    \\n    ym /= inds.length\\n    s2.data.ym = [ym, ym]\\n\\n    // necessary becasue we mutated source.data in-place\\n    s2.change.emit();  \\n\"},\"id\":\"2016\",\"type\":\"CustomJS\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"field\":\"color\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"field\":\"color\"},\"size\":{\"units\":\"screen\",\"value\":8},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2006\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2087\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"1980\"}},\"id\":\"2009\",\"type\":\"CDSView\"},{\"attributes\":{\"text\":\"Select Here\"},\"id\":\"1982\",\"type\":\"Title\"},{\"attributes\":{\"data_source\":{\"id\":\"1980\"},\"glyph\":{\"id\":\"2005\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2006\"},\"selection_glyph\":{\"id\":\"2007\"},\"view\":{\"id\":\"2009\"}},\"id\":\"2008\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis\":{\"id\":\"1992\"},\"ticker\":null},\"id\":\"1995\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1984\",\"type\":\"DataRange1d\"},{\"attributes\":{\"data_source\":{\"id\":\"2010\"},\"glyph\":{\"id\":\"2012\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2013\"},\"selection_glyph\":null,\"view\":{\"id\":\"2015\"}},\"id\":\"2014\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.4},\"fill_color\":{\"value\":\"firebrick\"},\"line_alpha\":{\"value\":0.4},\"line_color\":{\"value\":\"firebrick\"},\"size\":{\"units\":\"screen\",\"value\":8},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2007\",\"type\":\"Circle\"},{\"attributes\":{\"axis\":{\"id\":\"1996\"},\"dimension\":1,\"ticker\":null},\"id\":\"1999\",\"type\":\"Grid\"},{\"attributes\":{\"data\":{\"color\":[\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\",\"navy\"],\"x\":[0.007663211832076411,0.5237646697202054,0.49547720007991625,0.04540475066140848,0.3895203697387274,0.408401141462131,0.41355384107898874,0.6241485947924417,0.6765572272090192,0.950566434684523,0.5975963590393883,0.43388559973471474,0.49749139675568943,0.7809038706666875,0.22558269558543498,0.881433519126698,0.9187498782068971,0.41169905694969755,0.6079092634285553,0.0676577347393984,0.028419552657223734,0.6098782826975414,0.6408402624048609,0.22599814918365924,0.7193057355721518,0.6717337343296124,0.30080381013006197,0.444826023358302,0.7905023457327994,0.7923328616345978,0.4681383225704886,0.3925486993217743,0.5909910886771871,0.19092258385298377,0.7484045555770864,0.916004373997134,0.5952885232793683,0.5924454515277198,0.47252705279957674,0.3256050560709418,0.7362800319515943,0.3866843480767207,0.7200330668341053,0.40292815559639594,0.40939749658049196,0.8427699696185342,0.7492116724261132,0.5693787811107198,0.5791976213409722,0.9052848861512451,0.25679965546123695,0.9394986817183061,0.2755839046590989,0.25474553932285615,0.9534044398923708,0.9085769870687427,0.058231773724368496,0.6309175026179943,0.11619010655374351,0.5049757227812678,0.32880811983873137,0.9636630311002293,0.04048003817246504,0.20854856665691002,0.1461493763552264,0.16416208147590172,0.07417524231400052,0.6459231172427413,0.2705131448643676,0.6163342952471057,0.21384977309855557,0.5847977977707448,0.20153022423934586,0.9043307054639661,0.5173941095050686,0.9019187827739035,0.9503320092239376,0.9680720398826094,0.9144523460733324,0.7145280287274685,0.838620280836632,0.550435312720278,0.30554502602338485,0.6969149861154414,0.04237020801618141,0.4901826881674157,0.14202658039135263,0.5972924712998009,0.9381165127456884,0.555127287636274,0.14024642256013187,0.756183138475357,0.9186384749624078,0.574909520821239,0.9042567880959109,0.904716327019226,0.11327759884533373,0.01335310249896593,0.5790447193823565,0.6257142864920635,0.633301879350511,0.4790875590787316,0.759449056329869,0.01525478998883889,0.5469707362141748,0.6268803839316944,0.05674895363139565,0.15915432294360243,0.9494321234722954,0.013832562709997998,0.615479408900878,0.441275497055858,0.6519951243037877,0.598668331973819,0.9014862902338805,0.8930735408022467,0.19540436578406406,0.02903450267007246,0.24798251320209796,0.8950992548238278,0.6682786255979268,0.5719747610747675,0.9495896971148265,0.5478064985418182,0.03928810534190208,0.9129172847349718,0.7339002515117234,0.5054454881739487,0.8211545641795005,0.731376488902251,0.5012591806862763,0.1912205614547413,0.4222106213901279,0.6587160848784697,0.5492930353185833,0.4600016118362702,0.20381547864216587,0.5456605432080945,0.5537076732087499,0.2020668392541265,0.8722524094143388,0.35439875267746934,0.20757030996395465,0.628920071491292,0.3882431720423739,0.06325342648950716,0.8495321344788115,0.6698991556816559,0.11377588651028481,0.7129421270305024,0.9396980754178985,0.8154489891116504,0.438409830099187,0.29134555853221245,0.38427238547001186,0.08485538720321295,0.7908602387739585,0.6114726935372942,0.3778011128786324,0.8292635959858387,0.6833544154373781,0.28272746813046745,0.37838141615049703,0.10280387032780802,0.5895858711509114,0.03002611616125017,0.8924697589453754,0.9263634274836384,0.14247116703232998,0.6333964000497486,0.054632688988245026,0.6779251850719105,0.6407654774528413,0.9063950778952723,0.017572688677390258,0.6432277751897116,0.7488385831549997,0.333631596210213,0.2688838724247694,0.00843211538742239,0.32266959114903515,0.798168256584642,0.3030091302240243,0.040593440868421427,0.686291065680553,0.841633806464119,0.7875044409559321,0.5859278232720656,0.15940644031895512,0.4766562715359649,0.804168215988663,0.01848824534543314,0.5718357611472775,0.6798822531751275,0.9138734851491664,0.11750782556759432,0.7759464337535167,0.8099580520038928,0.47534965274503194,0.867964543045647,0.23096286390243248,0.844580265538361,0.09772508573192229,0.31891115108007406,0.05484996960112909,0.8268411790364131,0.4649323278563212,0.54985254036346,0.23430407912497475,0.09711049332019173,0.06620291425156544,0.7333581972447945,0.9007819098553081,0.6135359795552864,0.15450222523308588,0.10010059267344484,0.48962888993586284,0.9344964617453929,0.7611436600586823,0.7651697814286265,0.2420877872809475,0.6952616699484515,0.6703387646269389,0.5454783860747953,0.41032465345386127,0.48991542339039285,0.5101246907354268,0.7421828925978764,0.8491321593511835,0.5483794404252401,0.18344242552607004,0.03544539419933046,0.3018536531926853,0.4431039416609599,0.0502145328133945,0.15261520064868195,0.955743027026431,0.9212516685967769,0.325981639690598,0.9209148432322293,0.5718623868545928,0.19771556733424145,0.7723305362533369,0.6724981258425137,0.5700471134138806,0.3628195506055413,0.7625517824382086,0.4891302416527987,0.20581848929096547,0.053542378077652275,0.8753208699615103,0.5679091667531077,0.33161594996994237,0.49069938711894623,0.9635101725605846,0.872319036668548,0.18429864546190544,0.5563647090639273,0.7046991401476288,0.642462534332684,0.334515099430565,0.5014202775023303,0.6626908124041465,0.4184568265269758,0.5373071757196699,0.817709198830672,0.18701337576140353,0.8847077223432437,0.8023894487484392,0.11541444995760308,0.6798560090403952,0.702691613903313,0.6467313040626463,0.8898614425759811,0.8082281285710339,0.7507739284296286,0.17073356979357412,0.44163590899442484,0.20695758389273367,0.34068286339384446,0.44935029214480793,0.47888604715428207,0.0538928515679552,0.9274042773432137,0.06457751968589931,0.5294086074037989,0.7737351237452381,0.564185951556321,0.6460241129009339,0.21833925646293284,0.25622637485496846,0.24096709529734783,0.2636476814566163,0.13788948240895227,0.2727237459195697,0.6891026621372403,0.18139024321344577,0.7847340066059089,0.8731062636029623,0.9443621738410996,0.1537193885135575,0.28522503044126,0.6528839814640538,0.7929480420637601,0.9552868605282926,0.5479684782072199,0.39599130064560384,0.42415393039841054,0.7730080931507503,0.0029231527206011743,0.200961536725484,0.6584424357675067,0.7160569231749379,0.49858550088797327,0.016401807936957113,0.7786643032405721,0.6769989468841244,0.16500523258910815,0.13685456332585844,0.5824226924747586,0.4484249999619675,0.8227600657582971,0.8223717412670419,0.15982474318091333,0.26404140668598075,0.4899028180841313,0.6690162348490468,0.08619721366705335,0.5320244397303581,0.7798923056119441,0.15973118918200768,0.5004390270274113,0.26283307708930626,0.0054405979570110174,0.15370120148808075,0.6204840528280499,0.7004122014370256,0.8884733974703128,0.4908893847096917,0.7569240978673056,0.7161879907968085,0.9084860650655777,0.9185867013256865,0.35028512713729343,0.15531900148002098,0.7160148594416244,0.26466411361256537,0.9510645887867906,0.39095490767130303,0.7292342682101828,0.12488257934188585,0.9797109625049103,0.29989147211867584,0.31570865660041925,0.8698193652551522,0.6926871710099424,0.17969063003079722,0.8149021623745653,0.07767105067934155,0.2417331511290407,0.8675994835797723,0.9363260608764605,0.7194149897041556,0.9212148252021024,0.876747344579375,0.508199025473304,0.5018953249499395,0.8040366332786159,0.19004570333789306,0.8924979276267999,0.2905097266472141,0.5266710385667684,0.01762601155590604,0.6692155359134712,0.6097809332559158,0.08795928429412014,0.9547570199107979,0.5605271853794983,0.8043825288720151,0.2849479487729427,0.8142644898160744,0.8862884066332074,0.8783769478316114,0.4048273969521704,0.3000949959384427,0.25893812491048185,0.2162671570423076,0.2933121435375142,0.8234513246698566,0.8861697209245851,0.909589693221789,0.9812590293539879,0.8826434052392845,0.8526961986596958,0.045860052277886365,0.11986241030322975,0.508499214754423,0.7200360518815601,0.22016684901944594,0.7340358476739306,0.7157722510667787,0.03107199534482097,0.00024452899547844353,0.5556429346979881,0.8017819516994859,0.270910362396764,0.17936374723602255,0.36957121835079154,0.804895929783944,0.7383063150022088,0.6807447165017865,0.2510952791606349,0.23175293263700403,0.5874739454704198,0.20873058281965873,0.634246590648657,0.18319812033580452,0.04438422858854585,0.3377023618844127,0.22683647970281828,0.9720383432139152,0.48397319809946826,0.9355567784592846,0.5228030263143247,0.952248490263047,0.5870952235762587,0.36252518593589733,0.9262152324244618,0.1678598930738634,0.7418566851774008,0.5896201898803227,0.5810375238166036,0.5489240998986039,0.0904919032031708,0.06747275964936228,0.8264366012594985,0.5816680132648976,0.17969797095406892,0.5035399723113801,0.870766030752136,0.9026535855720068,0.06212270719754698,0.9554483092002545,0.8810686154606974,0.918800919234514,0.36734188021944714,0.36465967819783374,0.5632966774723884,0.09559054696116309,0.9168206555174534,0.4663073740795187,0.9694072451996787,0.3389884210052061,0.9138820966804361,0.7230256564166054,0.2924892696073442,0.05505073236907432,0.755864294197791,0.4059173183664826,0.9427188789978396,0.9944613653882507,0.5615367675838862,0.969044278293164,0.2785065798124964,0.3777707025182969,0.44982127964922936,0.9672223241959663,0.6438352854475116,0.5636855204018644,0.1314511408943564,0.6131368543169022,0.29839178794810894,0.9538415494856801,0.6675530679035376,0.29835439362924443,0.4886210759535756,0.42010308561018495,0.11925642978449003,0.31175702395072047,0.3399859663495042,0.06621795770902905,0.9510733064101633,0.4180419964698958,0.5525450063487183,0.829501820630085,0.5655572703160174,0.20922554858239473,0.25034078752287514,0.6411883517538284,0.11910121885333591,0.14325173171409977,0.9662031681600013,0.9802051268196585,0.5144113445453176,0.2002786292963714,0.6417634804616632,0.012815144057613193,0.7117430229312726,0.6638373535617368,0.1844412268130835],\"y\":[0.9156466782045314,0.010770198878685244,0.010871661082757833,0.2504956332747922,0.5001225831725248,0.7667532145022457,0.5486011597170521,0.4793069170677664,0.9340832595175041,0.6396654617034061,0.8559595036837977,0.6347057402390911,0.4876684170540785,0.8346298640304054,0.044011760327042126,0.057788938398545375,0.6087494829095127,0.8939551125906636,0.06462959444620786,0.3419145108634456,0.9311579819714518,0.6584873921662053,0.6601888519736536,0.716727264210927,0.10631320559347068,0.25841043392509844,0.7940329271569763,0.18212967979267713,0.4074332234089042,0.9521941065790678,0.6506956409321044,0.46052297912943163,0.09692417944736542,0.7239251635023844,0.3670483520902036,0.5996178148205423,0.014959231851052857,0.36153340287494795,0.19665118598635278,0.27261016055076526,0.9549180634567784,0.9409613536747836,0.9359101432668613,0.19910897021926222,0.14062834371653932,0.14438566886705217,0.6739506914509634,0.2814064892203585,0.9967744065753518,0.9530481753850025,0.2286893000793384,0.671174778702151,0.880328981808492,0.920586939788178,0.4299038362687785,0.7990683716971508,0.2061559461132666,0.9605222389439496,0.04369420895954457,0.5790332914181185,0.3332197398374498,0.5318718045572907,0.5336419526633792,0.7727733679157487,0.390561528382794,0.9986840232989814,0.6475298223901649,0.9985458021466569,0.26120043622129363,0.38264624161304184,0.05829060929228769,0.07477998144363374,0.16862332168675365,0.34825966288634125,0.031023424764590524,0.6848720718268281,0.44494934274676623,0.3122534853703549,0.42068588597911993,0.36390063246418203,0.17313162265047888,0.3120916066732118,0.5213746905176492,0.06578270554291521,0.7635037253116738,0.6748607327191206,0.7318783885499949,0.5984999626708817,0.807075026768486,0.8968623786752467,0.550702878556281,0.7128121588946271,0.4211078213926067,0.6704005899704222,0.06485240799163683,0.14328762284013208,0.8492006716154015,0.6236430343304606,0.3566553282665642,0.1669182069687506,0.6297894499272682,0.6982458630368864,0.743154233691075,0.20777902804195747,0.12023704245948674,0.8879262677811629,0.3078574407065947,0.7466074904213358,0.055043710797942014,0.9424243963838285,0.38262488071347134,0.947308803244701,0.5531295945686001,0.4299476026049438,0.12188601353505446,0.33440173325393396,0.30094851166384795,0.12803857727658208,0.5717551242157636,0.7141609695637672,0.8484808843503264,0.06608619410682426,0.3590821814946369,0.8271726486606162,0.5700623925800744,0.43921913144846547,0.48935758102823923,0.05854944101615034,0.6141788946917517,0.07970331347266024,0.3099897926866705,0.573774935180375,0.7696046487667704,0.8823194500934994,0.14842060598260443,0.608326291018147,0.4810615923656415,0.12510054949058713,0.19137796262006435,0.6241380456861018,0.12159902946409373,0.9221667353302171,0.659761805839691,0.38516820137909125,0.5836110537121262,0.803552052461554,0.8241851870616681,0.6823161827304365,0.06352009774831668,0.9637102813194558,0.02253068686738624,0.6655045402489795,0.5803005669150384,0.043747086069836905,0.4392738816077709,0.19251693240891865,0.0955417061457583,0.64364751550065,0.026421923198432284,0.08830356874436296,0.3530121737384325,0.26654137524427757,0.5843464333639982,0.7305304511339505,0.8897344597398671,0.7302118633642795,0.5522127247968062,0.728782703426485,0.4751494265547823,0.2507056182438546,0.7268650833286974,0.6844559850511442,0.714435676111828,0.22890037245915473,0.5529977359941206,0.9023973339026493,0.5835344256421238,0.2788759915517618,0.12942609234084357,0.24885462461198438,0.05629181792046034,0.38096106047059464,0.43175976047132947,0.5546541162294389,0.4397203494205243,0.9246863236793562,0.3770788011867545,0.05333642862604249,0.8180381613802326,0.4164794177278204,0.7016411570592108,0.6502590369769328,0.24788933652229372,0.4038833497855039,0.8188005442890376,0.4865457268210811,0.5775175260669089,0.35529413998563175,0.9168872458336277,0.07456835532552009,0.6393164396818767,0.7308647041717151,0.12260889864366598,0.47708920252999376,0.9214116368218825,0.5633757779855962,0.05962829259837832,0.45692205860338364,0.41980501658083835,0.6260420634586942,0.8918167023778486,0.8450807934463798,0.7647853151144247,0.37775133223000346,0.10213483679038615,0.34930688746090377,0.10985937726912298,0.13079359520905343,0.7067193647229082,0.9147657568018087,0.6192120004546985,0.5011954343315413,0.77338780353327,0.7743110256526607,0.8961504199364118,0.19004237820287118,0.4753973870319691,0.22431792425581287,0.7620347884764497,0.9039391529584867,0.7199222119360372,0.9007141986101197,0.794839672187136,0.2705155523913403,0.760566554384342,0.6997377297431479,0.5817193504547475,0.7124456821332448,0.2785259270959415,0.8406930319198694,0.7951878647144264,0.850048653773526,0.022107542828086024,0.4461742157610511,0.7065142484372602,0.6616394736854847,0.7505502151454263,0.47664428793220937,0.04199541193827738,0.21409918468307498,0.060565400142544745,0.4375048513179832,0.09273791389097552,0.2834233440810663,0.8785978191849331,0.8670887844843046,0.47276977094256734,0.518470204087836,0.041567983212046467,0.8696618424928354,0.3035320856279182,0.6397235312985216,0.04245762106641782,0.14682358641020488,0.5063244240080909,0.6620005540024945,0.02098444581337966,0.39795084169485706,0.9654401435893527,0.9853013409094973,0.7412004898993696,0.23267723904316628,0.25399396320547396,0.14456088567445013,0.3478395409659947,0.9212134372811175,0.13116012422703405,0.23729398803488733,0.5950864422620914,0.6893813024843621,0.6105198502685676,0.8640170218125057,0.6921926746899365,0.6913227941560562,0.9750813328676178,0.9406595045723712,0.13362792560929715,0.8430038933312615,0.6492915006216612,0.5958733006662469,0.6057306659989841,0.7637871329371767,0.8563167802303452,0.07232862394682837,0.3175039605455361,0.9634700765572028,0.9310200439288963,0.9685955825009105,0.48098233371053223,0.17321789389533537,0.7940538945998381,0.12225098869126028,0.4871293837006675,0.6880997710815061,0.973679045886521,0.38580460700329977,0.4259378136663261,0.8274738473011265,0.551892178206843,0.4312567005501423,0.09576278201369937,0.9963657873326133,0.819861093618849,0.5836384871709025,0.7730466319345964,0.3799762895243278,0.5719067961292463,0.16623023438326023,0.6477692880322231,0.12470867006933617,0.49543980083431016,0.8287146280079004,0.9448378130069908,0.7604705005378896,0.3255760785805052,0.731175892236579,0.48078388087308677,0.28586038477278086,0.2573268588636507,0.3354316130446988,0.08672051666868097,0.1500144072515246,0.47396655859061354,0.9642710267345695,0.2210823212383567,0.3758721206818928,0.9674579553601608,0.9320108998999445,0.9445283099776073,0.33136769569467617,0.2644632878298554,0.12243227582879812,0.8997955295251426,0.2583602938355316,0.03875773977215824,0.6010056560678382,0.5204940194043489,0.1787413588437421,0.6434896543749337,0.31323466326600746,0.45395361047904204,0.7205465298823165,0.4938638592532547,0.10295266614835397,0.7061976238594072,0.9570896234476219,0.7829527204216555,0.967947440145224,0.3106594742120793,0.4007011315433603,0.30395906997384237,0.09441015012285137,0.9965874784195287,0.3896127004982435,0.876387579887845,0.9883548051716003,0.29181841837542455,0.4393920591833417,0.2312979744864233,0.8560071380861899,0.13926109147463717,0.5199695132340391,0.6131133921232427,0.15244584831234753,0.7077981690985146,0.739696884636052,0.6786340044025165,0.3930226997893196,0.030386747692747185,0.8464027560147597,0.022490047620829845,0.7585317484011475,0.046445304384674646,0.4921534534010382,0.04622127722027336,0.8288869805732783,0.37234688976223695,0.07861565932963221,0.8905668944271553,0.6386743315335882,0.9522103290329221,0.24108142207476957,0.640107348565867,0.542167665389988,0.7335309207241609,0.24944204146456872,0.5208663540508706,0.420783651865396,0.966060178670879,0.641988736537303,0.32554887372696695,0.9588052905160744,0.621352287252455,0.3452312830636284,0.19432334159094555,0.10835255126012511,0.5223099584341931,0.32358535020878243,0.6195758827739991,0.8777886812077831,0.1363714925381948,0.9348954037913205,0.07713384914435273,0.09337598554376414,0.9416471896593602,0.15585433016987726,0.07847758621301126,0.9026265940201047,0.6151070716466605,0.5214690990506203,0.31946820971294143,0.35405722725703204,0.9081934721743196,0.13832619646036703,0.5217265821010638,0.7796863747599548,0.9387318194316856,0.046503726875851914,0.0723604816233403,0.4194057587964949,0.7584171960174027,0.6254162180148021,0.4093238790010595,0.6910123591292001,0.28365680962697615,0.0179855723790312,0.24681430939855242,0.06457618752568983,0.8549477566435066,0.010150674624789358,0.2951757153100203,0.84698895472259,0.5410647649835357,0.08437531015284716,0.01400194283243772,0.8247171107861782,0.9921089749431651,0.9289242918700206,0.21371805041783976,0.7361838827160706,0.4287351172765542,0.8617506650526756,0.4444100568357182,0.5311780848939003,0.19760316350556484,0.5306493618381374,0.266236509701971,0.3429727320447209,0.4171428613352254,0.6884052662608704,0.9151511627097964,0.9740799767365322,0.25109603548812,0.8497355194843825,0.5258401749177635,0.9137498915345155,0.6202757119489725,0.41214252489607206,0.4230880739679692,0.20820419594635065,0.11403756177383628,0.3475577473176924,0.0899628762584691,0.1471846224205965,0.5674537565355645,0.98397773027797,0.4749896153073425,0.6207593028622413,0.3664342806724581,0.6795248813445072,0.7123660841815322,0.925252705662466,0.43615705704041485,0.47384272488888035,0.5955105172908954,0.47062455196099473,0.8994945920768589,0.9481371374929577,0.8572767172366192,0.10296752885467098,0.6115201905697141,0.8100134576130864,0.6758866874119844,0.020905437195244403,0.20720592814179484,0.2622291024477409,0.27669057564031896,0.09554376996277458,0.6876877305863811,0.6001887889184065]},\"selected\":{\"id\":\"2017\"},\"selection_policy\":{\"id\":\"2090\"}},\"id\":\"1980\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1993\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1990\",\"type\":\"LinearScale\"},{\"attributes\":{\"overlay\":{\"id\":\"2001\"}},\"id\":\"2000\",\"type\":\"LassoSelectTool\"},{\"attributes\":{\"line_alpha\":0.1,\"line_color\":\"orange\",\"line_width\":5,\"x\":{\"field\":\"xm\"},\"y\":{\"field\":\"ym\"}},\"id\":\"2013\",\"type\":\"Line\"},{\"attributes\":{\"line_alpha\":0.6,\"line_color\":\"orange\",\"line_width\":5,\"x\":{\"field\":\"xm\"},\"y\":{\"field\":\"ym\"}},\"id\":\"2012\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"1997\",\"type\":\"BasicTicker\"},{\"attributes\":{\"source\":{\"id\":\"2010\"}},\"id\":\"2015\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1988\",\"type\":\"LinearScale\"},{\"attributes\":{\"formatter\":{\"id\":\"2087\"},\"ticker\":{\"id\":\"1997\"}},\"id\":\"1996\",\"type\":\"LinearAxis\"},{\"attributes\":{\"js_property_callbacks\":{\"change:indices\":[{\"id\":\"2016\"}]}},\"id\":\"2017\",\"type\":\"Selection\"},{\"attributes\":{\"formatter\":{\"id\":\"2085\"},\"ticker\":{\"id\":\"1993\"}},\"id\":\"1992\",\"type\":\"LinearAxis\"}],\"root_ids\":[\"1981\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.1\"}};\n",
       "  var render_items = [{\"docid\":\"28be63aa-fb84-431b-9b9b-8057f45ac74b\",\"root_ids\":[\"1981\"],\"roots\":{\"1981\":\"35b6ed41-fc93-4a8f-a500-8dc7fbc96f40\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "1981"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from random import random\n",
    "\n",
    "x = [random() for x in range(500)]\n",
    "y = [random() for y in range(500)]\n",
    "color = [\"navy\"] * len(x)\n",
    "\n",
    "s1 = ColumnDataSource(data=dict(x=x, y=y, color=color))\n",
    "p = figure(plot_width=400, plot_height=400, tools=\"lasso_select\", title=\"Select Here\")\n",
    "p.circle('x', 'y', color='color', size=8, alpha=0.4, source=s1, \n",
    "         selection_color=\"firebrick\", selection_alpha=0.4)\n",
    "\n",
    "s2 = ColumnDataSource(data=dict(xm=[0,1],ym=[0.5, 0.5]))\n",
    "p.line(x='xm', y='ym', color=\"orange\", line_width=5, alpha=0.6, source=s2)\n",
    "\n",
    "callback = CustomJS(args=dict(s1=s1, s2=s2), code=\"\"\"\n",
    "    var inds = s1.selected.indices;\n",
    "    if (inds.length == 0)\n",
    "        return;\n",
    "\n",
    "    var ym = 0\n",
    "    for (var i = 0; i < inds.length; i++) {\n",
    "        ym += s1.data.y[inds[i]]\n",
    "    }\n",
    "    \n",
    "    ym /= inds.length\n",
    "    s2.data.ym = [ym, ym]\n",
    "\n",
    "    // necessary becasue we mutated source.data in-place\n",
    "    s2.change.emit();  \n",
    "\"\"\")\n",
    "\n",
    "s1.selected.js_on_change('indices', callback)\n",
    "\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Exercise: Experiment with selection callbacks\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## CustomJS for UI Events\n",
    "\n",
    "Bokeh also has a general events system\n",
    "\n",
    "All of the available UI events, and their properties, are listed in the Reference Guide section for [bokeh.events](https://bokeh.pydata.org/en/latest/docs/reference/events.html)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "  <div class=\"bk-root\" id=\"d28c2974-9f19-4950-b41c-a6578823a2fb\" data-root-id=\"2183\"></div>\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function embed_document(root) {\n",
       "    \n",
       "  var docs_json = {\"80dd25ce-fdb3-46b5-a09c-e7688d602236\":{\"roots\":{\"references\":[{\"attributes\":{\"children\":[{\"id\":\"2181\"},{\"id\":\"2182\"}]},\"id\":\"2183\",\"type\":\"Column\"},{\"attributes\":{\"width\":400},\"id\":\"2180\",\"type\":\"Div\"},{\"attributes\":{\"axis\":{\"id\":\"2163\"},\"ticker\":null},\"id\":\"2166\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2264\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"2171\"}]},\"id\":\"2173\",\"type\":\"Toolbar\"},{\"attributes\":{\"axis\":{\"id\":\"2167\"},\"dimension\":1,\"ticker\":null},\"id\":\"2170\",\"type\":\"Grid\"},{\"attributes\":{\"icon\":null,\"js_event_callbacks\":{\"button_click\":[{\"id\":\"2184\"}]},\"width\":300},\"id\":\"2181\",\"type\":\"Button\"},{\"attributes\":{\"text\":\"\"},\"id\":\"2262\",\"type\":\"Title\"},{\"attributes\":{\"below\":[{\"id\":\"2163\"}],\"center\":[{\"id\":\"2166\"},{\"id\":\"2170\"}],\"js_event_callbacks\":{\"selectiongeometry\":[{\"id\":\"2185\"}]},\"left\":[{\"id\":\"2167\"}],\"renderers\":[{\"id\":\"2178\"}],\"title\":{\"id\":\"2262\"},\"toolbar\":{\"id\":\"2173\"},\"x_range\":{\"id\":\"2155\"},\"x_scale\":{\"id\":\"2159\"},\"y_range\":{\"id\":\"2157\"},\"y_scale\":{\"id\":\"2161\"}},\"id\":\"2154\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"2266\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"2172\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.6},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":null},\"radius\":{\"units\":\"data\",\"value\":1},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2176\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2270\",\"type\":\"Selection\"},{\"attributes\":{\"data\":{\"x\":{\"__ndarray__\":\"6n5Hl4RUOEDwhgHfHw3HP12o6w3ZPVRAcMFdNSqrKEBqDFgwcWgwQE1qX0SQHz1Aqs5ZHNNSR0BZT/9lvGMYQIO02m4tNidA33HnCYGQSkApJKpPHOoqQJ5RexFH5VFAU6mWBuRiRkDC2rzUe1EfQBs1g0VUWlJA0IlYV7llO0CuC0gAkNFXQEUF69rOCFVA0uHB520tVkDCwjlhI+JOQMmqgvdwNDBABx18EbsZUUCoL3W58vdOQBbUghZDA05A3a1eHoqrVkBF7ChC/B8AQO84pEbq/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QJLpm7Id8xVAhbHoXJPgVUBWhOuj8SVVQBQ4jFbnUyhAER/dKlOCEEAEzCYFwVT7P949x42551BAwLI/uZWT/z8XtgmLAoRCQBOVDevvJEVAak3LYC9HR0AET0NrhdFLQDe563NJqFZAff/uPLQpEEDJiW+R3INGQOx/TMy9FOc/O8mki0OFUEAGLiaIm79FQPhS4OP6E1BAV5KYgcC6V0B7kxKElt9DQPx/H7TevDFAQMpskd5CTEAEKRfkBChKQAgR2wMbdFNA/aazIWPUQUCArLGAhElRQDJQwV0qV0ZA2n1B94koH0Bjl0tQprNEQLwQBo1HBk1AMhOwT00UK0BIIPGtm2XfP26N14AvTBpA020fT5eqSUAQAxC533kXQAhLVcJ+20xA40FQoxFdV0DXgefPQq9JQNQduzmMYVdAndIp/SGhUEDv1JFNt8NNQCHtaZUfYDpAtijbVP01PEDSIgT8aidGQNEy5xdqjk9Aba5eSLxBNECYwu/y2R1JQIZRKANdA0JA8MPoK+u3UkCindQobMf2P+NPenGyIVdAueh1SvCHQEDjbwRQUINDQA==\",\"dtype\":\"float64\",\"shape\":[2000]}},\"selected\":{\"id\":\"2270\"},\"selection_policy\":{\"id\":\"2269\"}},\"id\":\"2175\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":null},\"radius\":{\"units\":\"data\",\"value\":1},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2177\",\"type\":\"Circle\"},{\"attributes\":{\"args\":{\"div\":{\"id\":\"2180\"}},\"code\":\"\\ndiv.text = \\\"Selection! <p> <p>\\\" + JSON.stringify(cb_obj.geometry, undefined, 2);\\n\"},\"id\":\"2185\",\"type\":\"CustomJS\"},{\"attributes\":{\"children\":[{\"id\":\"2154\"},{\"id\":\"2180\"}]},\"id\":\"2182\",\"type\":\"Row\"},{\"attributes\":{\"source\":{\"id\":\"2175\"}},\"id\":\"2179\",\"type\":\"CDSView\"},{\"attributes\":{\"args\":{\"div\":{\"id\":\"2180\"}},\"code\":\"\\ndiv.text = \\\"Button!\\\";\\n\"},\"id\":\"2184\",\"type\":\"CustomJS\"},{\"attributes\":{\"data_source\":{\"id\":\"2175\"},\"glyph\":{\"id\":\"2176\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2177\"},\"selection_glyph\":null,\"view\":{\"id\":\"2179\"}},\"id\":\"2178\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2159\",\"type\":\"LinearScale\"},{\"attributes\":{\"overlay\":{\"id\":\"2172\"}},\"id\":\"2171\",\"type\":\"BoxSelectTool\"},{\"attributes\":{},\"id\":\"2157\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"2161\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"2269\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2155\",\"type\":\"DataRange1d\"},{\"attributes\":{\"formatter\":{\"id\":\"2266\"},\"ticker\":{\"id\":\"2168\"}},\"id\":\"2167\",\"type\":\"LinearAxis\"},{\"attributes\":{\"formatter\":{\"id\":\"2264\"},\"ticker\":{\"id\":\"2164\"}},\"id\":\"2163\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"2168\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"2164\",\"type\":\"BasicTicker\"}],\"root_ids\":[\"2183\"]},\"title\":\"Bokeh Application\",\"version\":\"2.0.1\"}};\n",
       "  var render_items = [{\"docid\":\"80dd25ce-fdb3-46b5-a09c-e7688d602236\",\"root_ids\":[\"2183\"],\"roots\":{\"2183\":\"d28c2974-9f19-4950-b41c-a6578823a2fb\"}}];\n",
       "  root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n",
       "\n",
       "  }\n",
       "  if (root.Bokeh !== undefined) {\n",
       "    embed_document(root);\n",
       "  } else {\n",
       "    var attempts = 0;\n",
       "    var timer = setInterval(function(root) {\n",
       "      if (root.Bokeh !== undefined) {\n",
       "        clearInterval(timer);\n",
       "        embed_document(root);\n",
       "      } else {\n",
       "        attempts++;\n",
       "        if (attempts > 100) {\n",
       "          clearInterval(timer);\n",
       "          console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n",
       "        }\n",
       "      }\n",
       "    }, 10, root)\n",
       "  }\n",
       "})(window);"
      ],
      "application/vnd.bokehjs_exec.v0+json": ""
     },
     "metadata": {
      "application/vnd.bokehjs_exec.v0+json": {
       "id": "2183"
      }
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from bokeh.plotting import figure\n",
    "from bokeh import events\n",
    "from bokeh.models import CustomJS, Div, Button\n",
    "from bokeh.layouts import column, row\n",
    "\n",
    "import numpy as np\n",
    "x = np.random.random(size=2000) * 100\n",
    "y = np.random.random(size=2000) * 100\n",
    "\n",
    "p = figure(tools=\"box_select\")\n",
    "p.scatter(x, y, radius=1, fill_alpha=0.6, line_color=None)\n",
    "\n",
    "div = Div(width=400)\n",
    "button = Button(label=\"Button\", width=300)\n",
    "layout = column(button, row(p, div))\n",
    "\n",
    "# Events with no attributes\n",
    "button.js_on_event(events.ButtonClick,  CustomJS(args=dict(div=div), code=\"\"\"\n",
    "div.text = \"Button!\";\n",
    "\"\"\")) \n",
    "\n",
    "p.js_on_event(events.SelectionGeometry, CustomJS(args=dict(div=div), code=\"\"\"\n",
    "div.text = \"Selection! <p> <p>\" + JSON.stringify(cb_obj.geometry, undefined, 2);\n",
    "\"\"\"))\n",
    "\n",
    "show(layout)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Exercise: Create a plot that responds to different events from bokeh.events\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Additional Information\n",
    "\n",
    "There are many kinds of interactions and events that can be connected to `CustomJS` callbacks. \n",
    "\n",
    "\n",
    "* Widgets - Button, Toggle, Dropdown, TextInput, AutocompleteInput, Select, Multiselect, Slider, (DateRangeSlider), DatePicker,\n",
    "* Tools - TapTool, BoxSelectTool, HoverTool,\n",
    "* Selection - ColumnDataSource, AjaxDataSource, BlazeDataSource, ServerDataSource\n",
    "* Ranges - Range1d, DataRange1d, FactorRange\n",
    "\n",
    "\n",
    "For more complete examples the User Guide section on [JavaScript Interactions](https://bokeh.pydata.org/en/latest/docs/user_guide/interaction.html)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Next Section"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Click on this link to go to the next notebook: [07 - Bar and Categorical Data Plots](07%20-%20Bar%20and%20Categorical%20Data%20Plots.ipynb).\n",
    "\n",
    "To go back to the overview, click [here](00%20-%20Introduction%20and%20Setup.ipynb)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
